<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        while(true){
            let num= +prompt(`请你选择以下操作：
            1.存钱
            2.取钱
            3.查询余额
            4.退出
            `)
            if(num===4){
                break
            }
            switch (num) {
                case 1:
                    money1 = +prompt('请输入存钱金额')
                    break
                case 2:

                    money2 = +prompt('请输入取钱金额')
                    if (money2 > money1) {
                        alert('您的余额不足')
                    } else {
                        alert(`你取了${money2}元`)
                    }
                    break
                case 3:
                    money3 = money1 - money2
                    if (money3 >= 0) {
                        alert('您的余额为' + money3)
                    } else {
                        alert('您的余额为0')
                    }
                    break
                default:
                    alert('请输入1-4里面的数字')
            }
           
        }
        
    </script>
</body>
</html>